<?php
namespace app\member\model;

use app\BaseModel;
use think\facade\Db;

class RightsRelation extends BaseModel
{
    //会员权益表
    protected $name = 'longbing_card_member_rights_relation';


    /**
     * @author chenniang
     * @DataTime: 2020-07-15 09:49
     * @功能说明:添加
     */
    public function rightsAdd($data){

        $res = $this->insert($data);
        
        return $res;
    }


    /**
     * @author chenniang
     * @DataTime: 2020-04-26 17:12
     * @功能说明:列表
     */
    public function rightsList($dis,$page){

        $data = $this->where($dis)->order('id desc')->paginate($page)->toArray();

        return $data;
    }




    /**
     * @author chenniang
     * @DataTime: 2020-04-26 17:08
     * @功能说明:详情
     */
    public function rightsInfo($dis){

        $data = $this->where($dis)->find();

        return !empty($data)?$data->toArray():[];

    }


    /**
     * @author chenniang
     * @DataTime: 2020-04-26 17:13
     * @功能说明:删除直播
     */
    public function rightsUpdate($dis,$data){

        $data['update_time'] = time();

        $res = $this->where($dis)->update($data);

        return $res;

    }










}